# 作者: 宇
# 2025年02月21日16时56分47秒

class Person:
    def __init__(self,name,age,weight):
        self.name=name
        self.age=age
        self.weight=weight

    def run(self):
        self.weight-=0.5
        print(f"{self.name}跑步了,体重减少了0.5公斤{self.weight}")
    def eat(self):
        self.weight+=1
        print(f"{self.name}吃东西了,体重增加了1公斤{self.weight}")
    def __str__(self):#打印对象时输出的内容
        return self.name

    def __del__(self):#销毁时打印
        print(f"{self.name}死了")
class Dog:
    def __init__(self,name,color):
        self.name=name
        self.color=color

    def bark(self):
        pass
    def shake(self):
        pass
if __name__ == '__main__':

    elephant=Person('大象',18,80)
    tiger=Person('老虎',17,70)
    elephant.run()
    elephant.eat()
    print(elephant.weight)
    # print(dir(Person))
    print(elephant)
